﻿using System.Collections.Generic;
using System.Data;
namespace WPFExcelReport
{
    public partial class VAMMODUL
    {
        public void NEWMOD(Dictionary<string, object> pm)
        {
            int MNRs = int.Parse((string)pm["UPOS"]);
            if (MNRs == 1)
            {
                dwData = TBMain.NewRow();
                SetUpNewRow(ref dwData);
                dwData["AMMMANDANT"] = app.Mandant;
                dwData["AMMNRKRS"] = (string)pm["MKRS"];
                dwData["AMMLFDNR"] = (string)pm["MLFD"];
                dwData["AMMPOS"] = (string)pm["MPOS"];
                dwData["AMMMODNR"] = (string)pm["MNR"];
                dwData["AMMBEZ"] =Helpers.Helper.ConvertGB2312To8859P1("参数").PadRight(40);
                Insert(dwData);
            }
            else
            {
                for (int i = 1; i <= MNRs; i++)
                {
                    dwData = TBMain.NewRow();
                    SetUpNewRow(ref dwData);
                    dwData["AMMMANDANT"] = app.Mandant;
                    dwData["AMMNRKRS"] = (string)pm["MKRS"];
                    dwData["AMMLFDNR"] = (string)pm["MLFD"];
                    dwData["AMMPOS"] = (string)pm["MPOS"];
                    dwData["AMMMODNR"] = Helpers.Helper.Right("000" + i.ToString(), 3);
                    dwData["AMMBEZ"] = dwData["AMMMODNR"].ToString().PadRight(40);
                    Insert(dwData);
                }
            }
        }
        public void Insert(DataRow _dwAPK)
        {
            InsertAMMODUL(_dwAPK, app.company);
            TBMain.Rows.InsertAt(_dwAPK, 0);
        }
    }
    public partial class VAMMODUL
    {
        public string AMMNRKRS { get { if (dwMaster == null) return ""; return dwMaster["AMMNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMNRKRS"] = value; OnPropertyChanged("AMMNRKRS", value); } } //lENGth 2
        public string AMMLFDNR { get { if (dwMaster == null) return ""; return dwMaster["AMMLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMLFDNR"] = value; OnPropertyChanged("AMMLFDNR", value); } } //lENGth 4
        public string AMMPOS { get { if (dwMaster == null) return ""; return dwMaster["AMMPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMPOS"] = value; OnPropertyChanged("AMMPOS", value); } } //lENGth 2
        public string AMMMODNR { get { if (dwMaster == null) return ""; return dwMaster["AMMMODNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMMODNR"] = value; OnPropertyChanged("AMMMODNR", value); } } //lENGth 3
        public string AMMBEZ { get { if (dwMaster == null) return ""; return dwMaster["AMMBEZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBEZ"] = value; OnPropertyChanged("AMMBEZ", value); } } //lENGth 40

        #region======ColumnSchema==========
        /*
                 public string AMMMANDANT { get { if (dwMaster == null) return ""; return dwMaster["AMMMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMMANDANT"] = value; OnPropertyChanged("AMMMANDANT", value); } } //lENGth 2
                 public string AMMTYP { get { if (dwMaster == null) return ""; return dwMaster["AMMTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMTYP"] = value; OnPropertyChanged("AMMTYP", value); } } //lENGth 8
                 public string AMMART { get { if (dwMaster == null) return ""; return dwMaster["AMMART"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMART"] = value; OnPropertyChanged("AMMART", value); } } //lENGth 8
                 public string AMMLIEFNR { get { if (dwMaster == null) return ""; return dwMaster["AMMLIEFNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMLIEFNR"] = value; OnPropertyChanged("AMMLIEFNR", value); } } //lENGth 8
                 public string AMMHERST { get { if (dwMaster == null) return ""; return dwMaster["AMMHERST"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMHERST"] = value; OnPropertyChanged("AMMHERST", value); } } //lENGth 20
                 public string AMMINVNR { get { if (dwMaster == null) return ""; return dwMaster["AMMINVNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMINVNR"] = value; OnPropertyChanged("AMMINVNR", value); } } //lENGth 6
                 public string AMMINVPOS { get { if (dwMaster == null) return ""; return dwMaster["AMMINVPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMINVPOS"] = value; OnPropertyChanged("AMMINVPOS", value); } } //lENGth 2
                 public string AMMABSCHKZ { get { if (dwMaster == null) return ""; return dwMaster["AMMABSCHKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMABSCHKZ"] = value; OnPropertyChanged("AMMABSCHKZ", value); } } //lENGth 1
                 public double AMMABREITEV { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMABREITEV"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMABREITEV"] = value; OnPropertyChanged("AMMABREITEV", value); } } //lENGth 0
                 public double AMMABREITEB { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMABREITEB"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMABREITEB"] = value; OnPropertyChanged("AMMABREITEB", value); } } //lENGth 0
                 public double AMMFLMIN { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMFLMIN"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMFLMIN"] = value; OnPropertyChanged("AMMFLMIN", value); } } //lENGth 0
                 public double AMMFLMAX { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMFLMAX"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMFLMAX"] = value; OnPropertyChanged("AMMFLMAX", value); } } //lENGth 0
                 public double AMMSYSFL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMSYSFL"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMSYSFL"] = value; OnPropertyChanged("AMMSYSFL", value); } } //lENGth 0
                 public double AMMANSRUND { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMANSRUND"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMANSRUND"] = value; OnPropertyChanged("AMMANSRUND", value); } } //lENGth 0
                 public string AMMRAKELKZ { get { if (dwMaster == null) return ""; return dwMaster["AMMRAKELKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMRAKELKZ"] = value; OnPropertyChanged("AMMRAKELKZ", value); } } //lENGth 1
                 public double AMMLAENGE { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLAENGE"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLAENGE"] = value; OnPropertyChanged("AMMLAENGE", value); } } //lENGth 0
                 public double AMMLTRV1 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRV1"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRV1"] = value; OnPropertyChanged("AMMLTRV1", value); } } //lENGth 0
                 public double AMMLTRB1 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRB1"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRB1"] = value; OnPropertyChanged("AMMLTRB1", value); } } //lENGth 0
                 public string AMMBHSYS1 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHSYS1"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHSYS1"] = value; OnPropertyChanged("AMMBHSYS1", value); } } //lENGth 2
                 public string AMMBHMAX1 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHMAX1"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHMAX1"] = value; OnPropertyChanged("AMMBHMAX1", value); } } //lENGth 2
                 public double AMMLTRV2 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRV2"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRV2"] = value; OnPropertyChanged("AMMLTRV2", value); } } //lENGth 0
                 public double AMMLTRB2 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRB2"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRB2"] = value; OnPropertyChanged("AMMLTRB2", value); } } //lENGth 0
                 public string AMMBHSYS2 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHSYS2"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHSYS2"] = value; OnPropertyChanged("AMMBHSYS2", value); } } //lENGth 2
                 public string AMMBHMAX2 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHMAX2"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHMAX2"] = value; OnPropertyChanged("AMMBHMAX2", value); } } //lENGth 2
                 public double AMMLTRV3 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRV3"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRV3"] = value; OnPropertyChanged("AMMLTRV3", value); } } //lENGth 0
                 public double AMMLTRB3 { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMLTRB3"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMLTRB3"] = value; OnPropertyChanged("AMMLTRB3", value); } } //lENGth 0
                 public string AMMBHSYS3 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHSYS3"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHSYS3"] = value; OnPropertyChanged("AMMBHSYS3", value); } } //lENGth 2
                 public string AMMBHMAX3 { get { if (dwMaster == null) return ""; return dwMaster["AMMBHMAX3"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMBHMAX3"] = value; OnPropertyChanged("AMMBHMAX3", value); } } //lENGth 2
                 public string AMMNETFA { get { if (dwMaster == null) return ""; return dwMaster["AMMNETFA"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMNETFA"] = value; OnPropertyChanged("AMMNETFA", value); } } //lENGth 1
                 public string AMMFILLER { get { if (dwMaster == null) return ""; return dwMaster["AMMFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMFILLER"] = value; OnPropertyChanged("AMMFILLER", value); } } //lENGth 94
                 public double AMMAENDZL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMAENDZL"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMAENDZL"] = value; OnPropertyChanged("AMMAENDZL", value); } } //lENGth 0
                 public string AMMAENDBEN { get { if (dwMaster == null) return ""; return dwMaster["AMMAENDBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMAENDBEN"] = value; OnPropertyChanged("AMMAENDBEN", value); } } //lENGth 8
                 public double AMMAENDDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMAENDDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMAENDDAT"] = value; OnPropertyChanged("AMMAENDDAT", value); } } //lENGth 0
                 public string AMMNEUBEN { get { if (dwMaster == null) return ""; return dwMaster["AMMNEUBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMMNEUBEN"] = value; OnPropertyChanged("AMMNEUBEN", value); } } //lENGth 8
                 public double AMMNEUDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMMNEUDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMMNEUDAT"] = value; OnPropertyChanged("AMMNEUDAT", value); } } //lENGth 0
        */
        #endregion
    }
}

